package com.sunlands.zlcx.usercenter.repository;

import com.sunlands.zlcx.usercenter.domain.SchoolDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shixiaopeng
 */
@Repository
public interface SchoolRepository extends JpaRepository<SchoolDO, Long>, JpaSpecificationExecutor<SchoolDO> {

    Page<SchoolDO> findBySchoolNameLikeOrderByTypeDescIdAsc(String schoolName, Pageable pageable);

    Page<SchoolDO> findAllByOrderByTypeDescIdAsc(Pageable pageable);
}
